<!--
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/business/materialbox/VMaterialBox.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/business/materialbox/VMaterialBox.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'MaterialId',
                footer: "Foots",
                cnName: '库存统计',
                name: 'materialbox/VMaterialBox',
                url: "/VMaterialBox/",
                sortName: "MaterialId",
                foreignKey:null
            });
            const editFormFields = ref({"MaterialName":"","BatchNumber":"","Stock":"","OrderNumbers":""});
            const editFormOptions = ref([[{"title":"物料名称","field":"MaterialName","disabled":true},
                               {"title":"批号","field":"BatchNumber","disabled":true},
                               {"title":"库存数量（KG）","field":"Stock","disabled":true,"type":"decimal"}],
                              [{"title":"计划单号","field":"OrderNumbers","disabled":true}]]);
            const searchFormFields = ref({"MaterialName":"","BatchNumber":"","OrderNumbers":""});
            const searchFormOptions = ref([[{"title":"批号","field":"BatchNumber"},{"title":"物料名称","field":"MaterialName"},{"title":"计划单号","field":"OrderNumbers","type":"like"}]]);
            const columns = ref([{field:'MaterialId',title:'MaterialId',type:'string',width:110,hidden:true,require:true,align:'left'},
                       {field:'MaterialName',title:'物料名称',type:'string',link:true,width:110,readonly:true,align:'left',sort:true},
                       {field:'BatchNumber',title:'批号',type:'string',width:110,readonly:true,align:'left'},
                       {field:'Stock',title:'库存数量（KG）',type:'decimal',width:110,readonly:true,align:'left'},
                       {field:'OrderNumbers',title:'计划单号',type:'string',width:500,readonly:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
